package cn.kgc.redis.controller;

import cn.kgc.redis.entity.User;
import cn.kgc.redis.service.UserService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 课工场
 * @date 2024/5/31
 * @description
 */
@RestController
@RequestMapping("user")
public class UserController {


    @Resource
    private UserService userService;

    @RequestMapping("list")
    public List<User> userList(){
        return  userService.list();
    }


    @RequestMapping("delete")
    public Boolean deleteUser(Integer id){
        return  userService.removeById(id);
    }


}
